#include"process.h"                                                           

#define SIZE 101                                                                                    
#define MAX_RATIO 100                                                                                

const char* flag = "|/-\\";

void process(int ratio)
{
    int num = strlen(flag);
    static char bar[SIZE] = { 0 };
    if (ratio >= 0 && ratio <= MAX_RATIO)
    {
        bar[ratio] = '#';
        printf("[%-100s][%d%%][%c]\r", bar, ratio, flag[ratio % num]);
        fflush(stdout);
    }
}